require(['jquery','cookie','app', 'lay'], function ($) {
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(logins)', function (data) {
            debugger;
            var jon = {};
            jon['name'] = data.field.username;
            jon['pass'] = data.field.password;
            var re=JSON.parse(playAjax("1555508458589",JSON.stringify(jon)));
            alr(re['title']);
            setTimeout(function () {
                if (re['code']=='0') {
                    setCookie("token", re['data']['token']);
                    setCookie("user", re['data']['user']);
                    window.location.href="./vsp?code=1555508458589&token="+getCookie("token");
                }
            },1500);
            return false;
        });
    });
});